package gui;

import java.awt.Dimension;

import javax.swing.GroupLayout;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.LayoutStyle;

/**
 * @author hqthai01 Jan 2, 2015
 */
public class JRowItem extends JPanel {

	private static final long serialVersionUID = 0x3B1L;

	public JRowItem() {
		initComponents();
		this.setSize(new Dimension(this.getMinimumSize()));
	}

	private void initComponents() {

		lblName = new JLabel();
		lblPercent = new JLabel();

		setBackground(java.awt.Color.black);
		setBorder(null);
		setMaximumSize(new java.awt.Dimension(530, 32));
		setMinimumSize(new java.awt.Dimension(530, 32));

		lblName.setForeground(java.awt.Color.green);

		lblPercent.setForeground(java.awt.Color.green);

		GroupLayout layout = new GroupLayout(this);
		this.setLayout(layout);
		layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(
				layout.createSequentialGroup()
				.addContainerGap()
				.addComponent(lblName, GroupLayout.DEFAULT_SIZE,454, Short.MAX_VALUE)
				.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
				.addComponent(lblPercent)
				.addContainerGap()));
		layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
				.addGroup(GroupLayout.Alignment.TRAILING, layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
					.addComponent(lblName, GroupLayout.PREFERRED_SIZE, 30, GroupLayout.PREFERRED_SIZE)
					.addComponent(lblPercent, GroupLayout.PREFERRED_SIZE, 30, GroupLayout.PREFERRED_SIZE)));
	}
	
	public void setFileName(String filename){
		this.lblName.setText(filename);
	}
	
	public void setPercent(String percent){
		this.lblPercent.setText(percent);
	}

	private JLabel lblName;
	private JLabel lblPercent;
}
